def measure():
    temp = 30
    wetness = 10
    return temp, wetness


data = measure()  # 返回值可以一个变量接，也可以和返回数量相等的接
print(data)
a = 10
b = 5
a, b = b, a
print(a, b)


def print_info(name, gender=True):  # 缺省参数
    gender_test = 'boy'
    if not gender:
        gender_test = 'girl'
    print(f'{name}is{gender_test}')


print_info('xiaohong', False)
print_info('xiaoming')


def demo(num, *args, **kwargs):  # 1给num，2345给args，name给kwargs
    print(num)
    print(args)
    print(kwargs)


demo(1, 2, 3, 4, 5, name='xiaoming', age=18)


def num_number(num):
    print(num)
    if num == 1:
        return
    num_number(num - 1)  # 递归调用num_number


num_number(3)  # 缺省的使用


def taijie(n):
    if 1 == n or 2 == n:
        return n
    return taijie(n - 1) + taijie(n - 2)


print(taijie(3))  # n个台阶走一步两步上去
